<!--
 * @Date: 2022-07-12 23:37:57
 * @LastEditTime: 2022-07-13 00:05:11
-->
<template>
  <div :class="{'uc-choice': isChoice}" class="uc-main">
    <img :src="userInfo.pic" alt="" class="uc-img">
    <div class="uc-text">
      <div>{{userInfo.nickname}}</div>
      <div class="uc-chat-message">{{userInfo.latest_message}}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'UserContainer',
  props: {
    isChoice: Boolean,
    userInfo: {}
  },
  data () {
    return {
      // userInfo: {
      //   pic: '',
      //   nickname: '',
      //   latest_message: ''
      // }
    }
  }
}
</script>

<style>
.uc-main {
  height: 50px;
  width: 200px;
  padding: 10px;
  display: flex;
  cursor: pointer;
}
.uc-main:hover {
  background: rgb(228, 229, 230);
}
.uc-img {
  border-radius: 100%;
}
.uc-text {
  margin-left: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.uc-chat-message {
  height: 15px;
  color: #999;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  width: 140px;
  text-overflow: ellipsis;
}
</style>
